/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.f1x.api.message.fields;

// Generated by org.f1x.tools.DictionaryGenerator from QuickFIX dictionary
public enum CollInquiryResult implements org.f1x.api.message.types.IntEnum {
	SUCCESSFUL(0),
	INVALID_OR_UNKNOWN_INSTRUMENT(1),
	INVALID_OR_UNKNOWN_COLLATERAL_TYPE(2),
	INVALID_PARTIES(3),
	INVALID_TRANSPORT_TYPE_REQUESTED(4),
	INVALID_DESTINATION_REQUESTED(5),
	NO_COLLATERAL_FOUND_FOR_THE_TRADE_SPECIFIED(6),
	NO_COLLATERAL_FOUND_FOR_THE_ORDER_SPECIFIED(7),
	COLLATERAL_INQUIRY_TYPE_NOT_SUPPORTED(8),
	UNAUTHORIZED_FOR_COLLATERAL_INQUIRY(9),
	OTHER(99);

	private final int code;

	CollInquiryResult (int code) {
		this.code  = code;
	}

	public int getCode() { return code; }

	public static CollInquiryResult parse(String s) {
		switch(s) {
			case "0" : return SUCCESSFUL;
			case "1" : return INVALID_OR_UNKNOWN_INSTRUMENT;
			case "2" : return INVALID_OR_UNKNOWN_COLLATERAL_TYPE;
			case "3" : return INVALID_PARTIES;
			case "4" : return INVALID_TRANSPORT_TYPE_REQUESTED;
			case "5" : return INVALID_DESTINATION_REQUESTED;
			case "6" : return NO_COLLATERAL_FOUND_FOR_THE_TRADE_SPECIFIED;
			case "7" : return NO_COLLATERAL_FOUND_FOR_THE_ORDER_SPECIFIED;
			case "8" : return COLLATERAL_INQUIRY_TYPE_NOT_SUPPORTED;
			case "9" : return UNAUTHORIZED_FOR_COLLATERAL_INQUIRY;
			case "99" : return OTHER;
		}
		return null;
	}

}